BINNAME = ccc15k
CFLAGS = `pkg-config --cflags clanCore-2.1 clanDisplay-2.1 clanSound-2.1 clanVorbis-2.1 clanApp-2.1 clanGL-2.1 clanMikMod-2.1`
LIBS = `pkg-config --libs clanCore-2.1 clanDisplay-2.1 clanSound-2.1 clanVorbis-2.1 clanApp-2.1 clanGL-2.1 clanMikMod-2.1`
LOBJS = control.o gamemodel.o level.o object.o sound.o enemy.o graphics.o levelloader.o player.o engine.o item.o main.o resourcemanager.o drawableobject.o

all:ccc15k

ccc15k:$(LOBJS)
	g++  -pthread $(LOBJS) -o $(BINNAME) $(LIBS)

control.o:control.cpp control.h gameconstants.h
	g++ $(CFLAGS) -pthread -c control.cpp -o control.o

enemy.o:enemy.cpp enemy.h gameconstants.h
	g++ $(CFLAGS) -pthread -c enemy.cpp -o enemy.o

engine.o:engine.cpp engine.h gameconstants.h
	g++ $(CFLAGS) -pthread -c engine.cpp -o engine.o

gamemodel.o:gamemodel.cpp gamemodel.h gameconstants.h
	g++ $(CFLAGS) -pthread -c gamemodel.cpp -o gamemodel.o

graphics.o:graphics.cpp graphics.h drawableobject.h drawableobject.cpp gameconstants.h
	g++ $(CFLAGS) -pthread -c graphics.cpp -o graphics.o

item.o:item.cpp item.h gameconstants.h
	g++ $(CFLAGS) -pthread -c item.cpp -o item.o

level.o:level.cpp level.h gameconstants.h
	g++ $(CFLAGS) -pthread -c level.cpp -o level.o

levelloader.o:levelloader.cpp levelloader.h gameconstants.h
	g++ $(CFLAGS) -pthread -c levelloader.cpp -o levelloader.o

main.o:main.cpp main.h gameconstants.h
	g++ $(CFLAGS) -pthread -c main.cpp -o main.o

object.o:object.cpp object.h gameconstants.h
	g++ $(CFLAGS) -pthread -c object.cpp -o object.o

player.o:player.cpp player.h gameconstants.h
	g++ $(CFLAGS) -pthread -c player.cpp -o player.o

resourcemanager.o:resourcemanager.cpp resourcemanager.h gameconstants.h
	g++ $(CFLAGS) -pthread -c resourcemanager.cpp -o resourcemanager.o

sound.o:sound.cpp sound.h gameconstants.h
	g++ $(CFLAGS) -pthread -c sound.cpp -o sound.o

drawableobject.o:drawableobject.cpp drawableobject.h
	g++ $(CFLAGS) -pthread -c drawableobject.cpp -o drawableobject.o

clean:
	rm -f $(LOBJS) $(BINNAME)
